﻿using Abp;
using Abp.Castle.Logging.Log4Net;
using Abp.Modules;
using Castle.Facilities.Logging;
using System.Reflection;

namespace LpbPrj.Client.DatabaseHelper
{
    public class AbpFactory
    {
        public AbpBootstrapper _bootstrapper { get; set; }

        public AbpFactory()
        {
            _bootstrapper = AbpBootstrapper.Create<AbpUiModule>();
            _bootstrapper.IocManager.IocContainer.AddFacility<LoggingFacility>(f => f.UseAbpLog4Net().WithConfig("CfgFiles\\log4net.config"));
            _bootstrapper.Initialize();
        }
    }

    [DependsOn(typeof(ClientDataModule), typeof(ClientApplicationModule))]
    public class AbpUiModule : AbpModule
    {
        public override void Initialize()
        {
            IocManager.RegisterAssemblyByConvention(Assembly.GetExecutingAssembly());
        }
    }
}
